
export function topList(){
  let listIds=['3','0','2','1']
  return new Promise(function(reslove,reject){
    uni.request({
      url:'http://localhost:3000/toplist/detail',
      method:'GET',
      success: (res) => {
        // console.log(res);
        let result=res.data.list
        result.length=4;
        for(let i=0;i<listIds.length;i++){
          result[i].listId=listIds[i]
        }
        reslove(result)
      }
    })
  })
}

export function list(listId){
  return uni.request({
    url:`http://localhost:3000/toplist/detail?id=${listId}`,
    method:"GET"
  })
}